/**  
* @Title: WeiXinAction.java
* @Package cn.net.mtons.web.member.weixin
* @Description: TODO
* @author ma jinjian  
* @date 2016年2月8日 下午4:53:36
* @version V1.0  
*/ 
package cn.net.mtons.web.member.weixin;

import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.net.mtons.model.entity.form.MtonsCallbackForm;
import cn.net.mtons.web.BasicAction;
import cn.net.mtons.web.interfaces.weixin.IWeiXinAction;
import cn.net.mtons.weixin.MtonsBasicBiz;

/**
 * @ClassName: WeiXinAction
 * @Description: TODO
 * @author ma jinjian
 * @date 2016年2月8日 下午4:53:36
 *
 */
@Controller
@RequestMapping(value="/weixin")
public class WeiXinAction extends BasicAction implements IWeiXinAction {
	
	@Autowired(required=false)
	private MtonsBasicBiz basicBiz;

	private static Logger logger = Logger.getLogger("command");
	
	@SuppressWarnings("unused")
	private static Logger netLog = Logger.getLogger("netlog");
	
	/* (non-Javadoc)
	 * @see cn.net.mtons.web.interfaces.weixin.IWeiXinAction#callback(cn.net.mtons.model.entity.form.MtonsCallbackForm)
	 */
	@Override
	public void callback(MtonsCallbackForm form, HttpServletResponse response) {
		if(getHttpServletRequest().getMethod().equalsIgnoreCase("GET")){
			this.basicBiz.callback(form, response);
			logger.info("GET请求");
		}else if(getHttpServletRequest().getMethod().equalsIgnoreCase("POST")){
//			String param = getHttpServletRequest().getParameter("");
//			if(){
//				
//			}
			logger.info("POST请求");
		}
		logger.info(form);
	}
}
